/*
 *                    COPYRIGHT NOTICE
 *
 *           This code is copyright protected by Freedom Inc.
 *
 *              2001-2012 All Rights Are Reserved
 */
package com.freedom.oldsong.system.dto;

import java.util.List;

import java.util.ArrayList;

/**
 * @author steven.wang
 *
 */
public class PaginationResult {

	/**
	 * @name DEFAULT_PAGE_SIZE
	 * @type int
	 */
	public static final int DEFAULT_PAGE_SIZE = 20;
	
	/**
	 * @name DEFAULT_PAGE
	 * @type int
	 */
	public static final int DEFAULT_PAGE = 1;
	
	/**
	 * @name list
	 * @type List<?>
	 */
	private List<?> list = new ArrayList<Class<?>>();
	
	/**
	 * @name currentPage
	 * @type Integer
	 */
	private Integer currentPage = DEFAULT_PAGE;
	
	/**
	 * @name pageSize
	 * @type Integer
	 */
	private Integer pageSize = DEFAULT_PAGE_SIZE;

	/**
	 * @name totalCount
	 * @type Integer
	 */
	private Integer totalCount = 0;
	
	/**
	 * @name pageCount
	 * @type Integer
	 */
	private Integer pageCount = DEFAULT_PAGE;
	
	/**
	 * @name count
	 * @type int
	 */
	private int count=0;
	
	/**
	 * @name sort
	 * @type String
	 */
	private String sort;
	
	
	/**
	 * Creates a new instance of PaginationResult.
	 *
	 */
	public PaginationResult(){
		
	}
	
	
	/**
	 * Creates a new instance of PaginationResult.
	 *
	 * @param currentPage
	 * @param pageSize
	 * @param sort
	 */
	public PaginationResult(Integer currentPage, Integer pageSize, String sort) {
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		this.sort = sort;
	}

	/**
	 * @name getSort
	 *
	 * @return    
	 * String     
	 * @throws 
	*/
	public String getSort() {
		return sort;
	}

	/**
	 * @name setSort
	 *
	 * @param sort    
	 * void     
	 * @throws 
	*/
	public void setSort(String sort) {
		this.sort = sort;
	}
	
	/**
	 * @name getList
	 *
	 * @return    
	 * List<?>     
	 * @throws 
	*/
	public List<?> getList() {
		return list;
	}

	/**
	 * @name setList
	 *
	 * @param list    
	 * void     
	 * @throws 
	*/
	public void setList(List<?> list) {
		this.list = list;
	}

	/**
	 * @name getPageSize
	 *
	 * @return    
	 * Integer     
	 * @throws 
	*/
	public Integer getPageSize() {
		return pageSize;
	}

	/**
	 * @name setPageSize
	 *
	 * @param pageSize    
	 * void     
	 * @throws 
	*/
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	/**
	 * @name getTotalCount
	 *
	 * @return    
	 * Integer     
	 * @throws 
	*/
	public Integer getTotalCount() {
		return totalCount;
	}

	/**
	 * @name setTotalCount
	 *
	 * @param totalCount    
	 * void     
	 * @throws 
	*/
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}

	/**
	 * @name getPageCount
	 *
	 * @return    
	 * Integer     
	 * @throws 
	*/
	public Integer getPageCount() {
		return pageCount;
	}

	/**
	 * @name getCurrentPage
	 *
	 * @return    
	 * Integer     
	 * @throws 
	*/
	public Integer getCurrentPage() {
		return currentPage;
	}

	/**
	 * @name setCurrentPage
	 *
	 * @param currentPage    
	 * void     
	 * @throws 
	*/
	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}

	/**
	 * @name setPageCount
	 *
	 * @param pageCount    
	 * void     
	 * @throws 
	*/
	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}

	/**
	 * @name getCount
	 *
	 * @return    
	 * int     
	 * @throws 
	*/
	public int getCount() {
		if(list!=null){
			this.count = list.size();
		}
		return count;
	}

	/**
	 * @name setCount
	 *
	 * @param count    
	 * void     
	 * @throws 
	*/
	public void setCount(int count) {
		this.count = count;
	}
	
	
}